.class Llt/noframe/gpsfarmguide/views/ActivitySave$4$1;
.super Ljava/lang/Object;
.source "ActivitySave.java"

# interfaces
.implements Landroid/view/View$OnClickListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Llt/noframe/gpsfarmguide/views/ActivitySave$4;->onShow(Landroid/content/DialogInterface;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$1:Llt/noframe/gpsfarmguide/views/ActivitySave$4;


# direct methods
.method constructor <init>(Llt/noframe/gpsfarmguide/views/ActivitySave$4;)V
    .locals 0

    .line 204
    iput-object p1, p0, Llt/noframe/gpsfarmguide/views/ActivitySave$4$1;->this$1:Llt/noframe/gpsfarmguide/views/ActivitySave$4;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onClick(Landroid/view/View;)V
    .locals 3

    .line 208
    iget-object p1, p0, Llt/noframe/gpsfarmguide/views/ActivitySave$4$1;->this$1:Llt/noframe/gpsfarmguide/views/ActivitySave$4;

    iget-object p1, p1, Llt/noframe/gpsfarmguide/views/ActivitySave$4;->val$input:Landroid/widget/EditText;

    invoke-virtual {p1}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object p1

    .line 209
    iget-object v0, p0, Llt/noframe/gpsfarmguide/views/ActivitySave$4$1;->this$1:Llt/noframe/gpsfarmguide/views/ActivitySave$4;

    iget-object v0, v0, Llt/noframe/gpsfarmguide/views/ActivitySave$4;->this$0:Llt/noframe/gpsfarmguide/views/ActivitySave;

    invoke-static {v0}, Llt/noframe/gpsfarmguide/views/ActivitySave;->access$200(Llt/noframe/gpsfarmguide/views/ActivitySave;)Llt/noframe/gpsfarmguide/utils/Validator;

    move-result-object v0

    iget-object v1, p0, Llt/noframe/gpsfarmguide/views/ActivitySave$4$1;->this$1:Llt/noframe/gpsfarmguide/views/ActivitySave$4;

    iget-object v1, v1, Llt/noframe/gpsfarmguide/views/ActivitySave$4;->val$input:Landroid/widget/EditText;

    invoke-virtual {v0, v1}, Llt/noframe/gpsfarmguide/utils/Validator;->isEmpty(Landroid/widget/EditText;)Z

    move-result v0

    const/4 v1, 0x0

    if-eqz v0, :cond_0

    .line 210
    iget-object p1, p0, Llt/noframe/gpsfarmguide/views/ActivitySave$4$1;->this$1:Llt/noframe/gpsfarmguide/views/ActivitySave$4;

    iget-object p1, p1, Llt/noframe/gpsfarmguide/views/ActivitySave$4;->this$0:Llt/noframe/gpsfarmguide/views/ActivitySave;

    invoke-static {p1}, Llt/noframe/gpsfarmguide/views/ActivitySave;->access$000(Llt/noframe/gpsfarmguide/views/ActivitySave;)Landroid/widget/Spinner;

    move-result-object p1

    invoke-virtual {p1, v1}, Landroid/widget/Spinner;->setSelection(I)V

    goto :goto_0

    .line 212
    :cond_0
    invoke-static {}, Llt/noframe/gpsfarmguide/database/DB;->getDB()Llt/noframe/gpsfarmguide/database/DB;

    move-result-object v0

    invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Llt/noframe/gpsfarmguide/database/DB;->isGroupExists(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_1

    .line 213
    iget-object p1, p0, Llt/noframe/gpsfarmguide/views/ActivitySave$4$1;->this$1:Llt/noframe/gpsfarmguide/views/ActivitySave$4;

    iget-object v0, p1, Llt/noframe/gpsfarmguide/views/ActivitySave$4;->this$0:Llt/noframe/gpsfarmguide/views/ActivitySave;

    iget-object p1, p1, Llt/noframe/gpsfarmguide/views/ActivitySave$4;->val$input:Landroid/widget/EditText;

    const v2, 0x7f110114

    invoke-virtual {v0, v2}, Landroid/app/Activity;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-static {v0, p1, v2}, Llt/noframe/gpsfarmguide/utils/Errors;->setError(Landroid/content/Context;Landroid/widget/EditText;Ljava/lang/String;)V

    .line 214
    iget-object p1, p0, Llt/noframe/gpsfarmguide/views/ActivitySave$4$1;->this$1:Llt/noframe/gpsfarmguide/views/ActivitySave$4;

    iget-object p1, p1, Llt/noframe/gpsfarmguide/views/ActivitySave$4;->this$0:Llt/noframe/gpsfarmguide/views/ActivitySave;

    invoke-static {p1}, Llt/noframe/gpsfarmguide/views/ActivitySave;->access$000(Llt/noframe/gpsfarmguide/views/ActivitySave;)Landroid/widget/Spinner;

    move-result-object p1

    invoke-virtual {p1, v1}, Landroid/widget/Spinner;->setSelection(I)V

    goto :goto_0

    .line 217
    :cond_1
    invoke-static {}, Llt/noframe/gpsfarmguide/database/DB;->getDB()Llt/noframe/gpsfarmguide/database/DB;

    move-result-object v0

    new-instance v1, Llt/noframe/gpsfarmguide/models/GroupModel;

    invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object p1

    invoke-direct {v1, p1}, Llt/noframe/gpsfarmguide/models/GroupModel;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0, v1}, Llt/noframe/gpsfarmguide/database/DB;->saveGroup(Llt/noframe/gpsfarmguide/models/GroupModel;)V

    .line 218
    iget-object p1, p0, Llt/noframe/gpsfarmguide/views/ActivitySave$4$1;->this$1:Llt/noframe/gpsfarmguide/views/ActivitySave$4;

    iget-object p1, p1, Llt/noframe/gpsfarmguide/views/ActivitySave$4;->this$0:Llt/noframe/gpsfarmguide/views/ActivitySave;

    invoke-static {p1}, Llt/noframe/gpsfarmguide/views/ActivitySave;->access$300(Llt/noframe/gpsfarmguide/views/ActivitySave;)V

    .line 219
    iget-object p1, p0, Llt/noframe/gpsfarmguide/views/ActivitySave$4$1;->this$1:Llt/noframe/gpsfarmguide/views/ActivitySave$4;

    iget-object p1, p1, Llt/noframe/gpsfarmguide/views/ActivitySave$4;->this$0:Llt/noframe/gpsfarmguide/views/ActivitySave;

    invoke-static {p1}, Llt/noframe/gpsfarmguide/views/ActivitySave;->access$000(Llt/noframe/gpsfarmguide/views/ActivitySave;)Landroid/widget/Spinner;

    move-result-object p1

    iget-object v0, p0, Llt/noframe/gpsfarmguide/views/ActivitySave$4$1;->this$1:Llt/noframe/gpsfarmguide/views/ActivitySave$4;

    iget-object v0, v0, Llt/noframe/gpsfarmguide/views/ActivitySave$4;->this$0:Llt/noframe/gpsfarmguide/views/ActivitySave;

    invoke-static {v0}, Llt/noframe/gpsfarmguide/views/ActivitySave;->access$400(Llt/noframe/gpsfarmguide/views/ActivitySave;)Ljava/util/List;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    add-int/lit8 v0, v0, -0x2

    invoke-virtual {p1, v0}, Landroid/widget/Spinner;->setSelection(I)V

    .line 220
    iget-object p1, p0, Llt/noframe/gpsfarmguide/views/ActivitySave$4$1;->this$1:Llt/noframe/gpsfarmguide/views/ActivitySave$4;

    iget-object p1, p1, Llt/noframe/gpsfarmguide/views/ActivitySave$4;->val$groupCreateDialog:Landroid/app/AlertDialog;

    invoke-virtual {p1}, Landroid/app/AlertDialog;->dismiss()V

    :goto_0
    return-void
.end method
